package com.xiangjun.proxytest.cglibdynamicproxytest;

import net.sf.cglib.core.DebuggingClassWriter;

public class test {
    public static void main(String[] args) {

        //注意，java 9以上的版本中，要使用cglib代理的话，启动项中的虚拟机选项必须要加以下配置，
        //--add-opens java.base/java.lang=ALL-UNNAMED

        System.setProperty(DebuggingClassWriter.DEBUG_LOCATION_PROPERTY, "target/classes");


        HttpOrigin httpOrigin = new HttpOrigin();
        HttpOrigin httpOriginProxy = (HttpOrigin) new CglibProxyFactory().getProxy(httpOrigin);
        httpOriginProxy.post("1");
        httpOriginProxy.get("1");
    }
}
